<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use TestingDeveloperService;

class DeveloperController extends Controller
{
    public function getDeveloperInfoByUnionCode($unionCode){
        if(!$unionCode){
            return apiErrcode('unionCode');
        }
        if(!$developer = TestingDeveloperService::getByUnionCode($unionCode)){
            return apiErrcode('unionCode');
        }
        return apiSuccess($developer);

    }


    public function getDeveloperInfoByAppid($appid){
        if(!$appid){
            return apiErrcode('appid_invalid');
        }
        if(!$developer = TestingDeveloperService::getWithAppid($appid)){
            return apiErrcode('appid_invalid');
        }
        return apiSuccess($developer);
    }

}
